import {ResDto} from "../types/common";
import instance from "../axios.service";
import {BaseUrl} from "../common/constants";

export default {
    getList: (params: any): Promise<ResDto> => instance.get(`${BaseUrl}/v1/user/info`, {params}),
    create: (data: any): Promise<ResDto> => instance.post(`${BaseUrl}/v1/user/busInfo`, data),
    edit: (data: any): Promise<ResDto> => instance.post(`${BaseUrl}/v1/user/basicInfo`, data),
    updatePwd: (userName: string, password: string): Promise<ResDto> => instance.get(`${BaseUrl}/v1/user/dealPassword/${userName}/${password}`),
    recharge: (data: {userName: string, amount: number}): Promise<ResDto> => instance.post(`${BaseUrl}/v1/amount/rechage?userName=${data.userName}&amount=${data.amount}`),
    getUserAmountList: (params: any): Promise<ResDto> => instance.get(`${BaseUrl}/v1/amount/userAmount`, {params}),
}
